/*
角色管理相关的API请求函数
*/
import request from '@/utils/request'

const api_name = '/admin/acl/role'

export const getPageList = (page, limit, searchObj)=>request({
    url: `${api_name}/${page}/${limit}`,
    method: 'get',
    params: searchObj // url查询字符串或表单键值对
})
export const getById = (id)=>request({
    url: `${api_name}/get/${id}`,
    method: 'get'
})
export const save = (role)=>request({
    url: `${api_name}/save`,
    method: 'post',
    data: role
})
///admin/product/attrInfoList/{category1Id}/{category2Id}/{category3Id}
export const updateById = (role)=>request({
    url: `${api_name}/update`,
      method: 'put',
      data: role
})






 /*
  获取一个角色的所有权限列表
  */
export const getAssign = (roleId)=>request({
    url: `${api_name}/toAssign/${roleId}`,
    method: 'get'
})
export const removeById = (id)=>request({
    url: `${api_name}/toAssign/${roleId}`,
    method: 'get'
})
export const removeRoles = (ids)=>request({
    url: `${api_name}/batchRemove`,
      method: 'delete',
      data: ids
})
